/**
 * Company : Thai Informatic System Co., Ltd.
 * Created By : Dr.Tree
 * Created On : Mar 16, 2012  11:53:31 AM 
 * e-Mail : chatree@tis.co.th
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : jpa.service.promis.common
 * File Name : VwSyncCrnoteRentalServices.java
 * TODO
 */
package jpa.service.promis.common;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.persistence.EntityManager;

import jpa.entitys.promis.common.VwSyncCrnoteRental;
import jpa.service.common.JPAService;

/**
 * @author chatree
 *
 */
public class VwSyncCrnoteRentalServices extends JPAService {

	/**
	 * @param em
	 */
	public VwSyncCrnoteRentalServices(EntityManager em) {
		super(em);
		// TODO Auto-generated constructor stub
	}


	public List<VwSyncCrnoteRental> findAll() throws Exception 
	{
		return super.ConvertToYoureObject(super.findAll("VwSyncCrnoteRental.findAll"));
	}
	
	public VwSyncCrnoteRental findById(String id) throws Exception {		
		
		return super.ConvertToYoureObject(super.find(id, "VwSyncCrnoteRental.findById"));				
	}	
	
	public List<VwSyncCrnoteRental> findByDocumentNo(String company, String project, String documentNo, String status, String syncIsstaging) throws Exception {
		Map<String,Object> mapWhereValue = new HashMap<String, Object>();				
		mapWhereValue.put("company", company);
		mapWhereValue.put("project", project);
		mapWhereValue.put("documentNo", documentNo);
		mapWhereValue.put("status", status);
		mapWhereValue.put("syncIsstaging", syncIsstaging);
		
		return super.ConvertToYoureObject(super.find("VwSyncCrnoteRental.findByDocumentNo", mapWhereValue));
		
	}
}
